﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Simple GeoRSS</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="http://www.bing.com/api/maps/mapcontrol?callback=GetMap" async defer></script>

    <script type="text/javascript">
          var map = null;
          var MM = Microsoft.Maps;
          var infobox = null;

          function GetMap() {
              var options = { credentials: "YOUR_BING_MAPS_KEY",
                  mapTypeId: Microsoft.Maps.MapTypeId.road,
                  center: new MM.Location(54.87350326912944, 15.333815098500053),
                  zoom: 4
              };
              map = new MM.Map(document.getElementById('divMap'), options);

              infobox = new Microsoft.Maps.Infobox(map.getCenter(), { visible: false });
              infobox.setMap(map);

              // Hide the info box when the map is moved.
              MM.Events.addHandler(map, 'viewchange', hideInfobox);
          }

          function LoadModule() {
              // Register and load a new module
              MM.registerModule("SimpleGeoRSSModule", "scripts/SimpleGeoRSSModule.js");
              MM.loadModule("SimpleGeoRSSModule", { callback: ModuleLoaded });
          }

          function ModuleLoaded() {
              // Use the function provided by the newly loaded module
              var myModule = new GeoRSSModule(map);
              myModule.ImportGeoRSS(document.getElementById("txtGeoRSS").value);
          }

          //Display InfoBox
          function showInfoBox(e) {
              var loc = e.location;

              if (e.targetType == "pushpin") {
                  loc = e.target.getLocation();
              }

              infobox.setOptions({ location: loc, title: e.target.title, description: e.target.description, visible: true });
          }

          function hideInfobox(e) {
              try {
                  infobox.setOptions({ visible: false });
              }
              catch (err) {
              }
          }
    </script>
</head>
<body>
    <div id='divCtrl'>
        <a style="margin-left:10px">GeoRSS-Feed</a>
        <input id="txtGeoRSS" type="text" style="margin-top:4px; margin-left:5px" value="data/MSFT_London.xml" />
        <input id="Button1" type="button" value="Import" onclick="LoadModule()" />
    </div>

    <div id='divMap' style="position:relative;width:600px; height:600px;"></div>
</body>
</html>